package com.xbongbong.pro.dynamic.pojo.dto;

import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.pojo.dto.FormDataDeleteBatchDTO;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

/**
 *动态
 *
 *@author weijianxun
 */
@Setter
@Getter
@ToString
public class DynamicDeleteDTO implements Serializable {
    private static final long serialVersionUID = -6746410175810812566L;

    /**
     * 用户删除信息
     */
    private FormDataDeleteBatchDTO formDataDeleteBatchDTO;
    /**
     * 允许被删除的id
     */
    private List<Long> allowDeleteDataIds = Collections.EMPTY_LIST;

    private List<PaasFormDataEntityExt> allowDeletePaasFormDatas;

    public DynamicDeleteDTO() {
    }

    public DynamicDeleteDTO(FormDataDeleteBatchDTO formDataDeleteBatchDTO, List<Long> allowDeleteDataIds, List<PaasFormDataEntityExt> allowDeletePaasFormDatas) {
        this.formDataDeleteBatchDTO = formDataDeleteBatchDTO;
        this.allowDeleteDataIds = allowDeleteDataIds;
        this.allowDeletePaasFormDatas = allowDeletePaasFormDatas;
    }

    public static DynamicDeleteDTO initDynamicDeleteDTO(FormDataDeleteBatchDTO formDataDeleteBatchDTO, List<Long> allowDeleteDataIds, List<PaasFormDataEntityExt> allowDeletePaasFormDatas) {
        DynamicDeleteDTO dynamicDeleteDTO = new DynamicDeleteDTO();
        dynamicDeleteDTO.setFormDataDeleteBatchDTO(formDataDeleteBatchDTO);
        dynamicDeleteDTO.setAllowDeleteDataIds(allowDeleteDataIds);
        dynamicDeleteDTO.setAllowDeletePaasFormDatas(allowDeletePaasFormDatas);
        return dynamicDeleteDTO;
    }
}
